![]() METHOD AND SYSTEM TO CONVERT A DIGITAL COLOR IMAGE TO GRAY SCALE (Machine-translation by Google Tran
专利摘要:
A method and system for converting a color image (31) to grayscale (43) applicable within the field of digital image processing is described, enabling its implementation in the form of hardware or software in both electronic devices and editing programs. of pictures. The system obtains the value of each pixel in the three channels R, G, and B in an input unit (32); in a processing unit (46) three normalized channels L, M, and S are calculated and a fourth normalized channel LM is generated, the activity, A, of each pixel is also determined according to the values of the normalized channels; by overweight said activity A for warm colors, and underweight for cold colors, the final value of each pixel, A', is determined in the grayscale image (43). A user interface (42) allows entering values of the weight constants. Finally, an output unit (44) is responsible for displaying the grayscale image. (Machine-translation by Google Translate, not legally binding) 公开号:ES2774013A1 申请号:ES201831253 申请日:2018-12-20 公开日:2020-07-16 发明作者:Zamorano Mariano Rincon;Cesteros Oscar Sanchez 申请人:Universidad Nacional de Educacion a Distancia UNED; IPC主号:
专利说明:
[0002] Technical field of the invention [0004] The present invention falls within the field of digital image processing and specifically within converters from RGB to grayscale - commonly known as color to black and white transformation. [0006] State of the art [0008] Color is an ancient subject of study, but its scientific treatment in order to have methods that analyze, classify or describe it, is contemporary [1] [2] [3]. Newton, in his Optics [4], already mentioned it, and defined it as a property of light, and therefore as a "physical effect". First Goethe [5], and with greater intensity Schopenhauer [6], would discuss this definition including several more categories, such as chemical color (produced by the incidence of light on surfaces and its subsequent transformation) or physiological color (generated from of the processes of the perception system and that is the cause of effects or processes such as the post-image), and indicating that, although color has its origin in light, the visual perception system has an active role, transforming the signal original in the final subjective expression that we understand by color. Schopenhauer would come to a confrontation with Newtonian theory, indicating that color is a physiological effect of the perception system, existing as such, and only, in the brain. [0010] From the beginning of the 19th century and until the middle of the 20th, there would be two main theories centered on two scientific positions. On the one hand, the trichromatic theory, based on Newton, developed by Thomas Young at the beginning of the XIX century and finally defined by Von Helmholtz [7] at the end of this century. And on the other hand, the theory of opposite processes, defined by Hering [8] largely from Goethe and Schopenhauer. With the advancement of neuroscience, the debate would be closed including both theories, where the first, trichromatic, is related to the sensory uptake of light in the retina, and the second, opposite processes, with neural processing. [0012] Regarding the organization of colors in a hierarchy, the subject is broader, and has been the object of study initially by artists and, especially from the middle of the 20th century, for the psychology of art [9]. There are different models to represent color, and the consensus is more complex, although it can be established that there are some so-called primary colors that, through mixing with each other, give secondary colors, these, in turn, to tertiary colors, and so on until reaching millions of combinations. From Runge's color sphere [10], to Munsell's [11], passing through wheel systems or pyramids, but in no case is a hierarchy established until reaching the Krueppers [12] hexagon model (see figure 2 ). Krueppers' model does establish a hierarchy with its "rhombohedron" that goes from white, through yellow, red, green and blue, to black. Determining this hierarchy is a necessary step to obtain a scale where the properties of each color are reflected in the transformation to gray levels, but it is difficult to determine an effective conversion from the RGB model. In [6], Schopenhauer describes a relationship between the hierarchy and the division of the activity of the retina, in such a way that the white corresponds to the full activity and the black to the total absence of activity, while the yellow is% of activity, red and green /, and blue 1% (see figure 3). Schopenhauer indicates that there is, in addition to this division, which he calls quantitative, another qualitative one that determines the presence or absence of activity. Ultimately, if yellow is% of activity, it is% of inactivity, and in turn, yellow together with its opposite, blue (with% of activity), add up to one, the full activity of the retina. In this way, his system precedes the system of opposite colors that Hering would later develop, but for our purpose, he relates it to a hierarchy. [0014] Furthermore, in the visual arts, the distinction between warm and cold colors is very common [1], which allows to establish the color contrast also by category. Berlin and Kay [13], after studying different languages around the world, showed that colors are universal and independent of cultural sensitivities. E. Rosch [14] discovered a tribe in New Guinea (Los Danis) with only two categories: light-warm and cold-dark. They learned the colors red, green, blue, and yellow (the primary colors for the opposite processes) much faster than the others. A justification for this fact is that there is a neural structure that analyzes the relationships between opposite colors and, therefore, the visual perception of the contrast between the categories warm and light as opposed to cold and dark. [0016] Schopenhauer knew the final effect of the brain's processing of colors, but not how it was produced, although he sensed that it was a physiological problem. However, today, the knowledge of all the organs involved in vision is wide. [0017] Davida Teller [15] defined the structure of the retina in two architectures, the first trichromatic and the second of opposite processes— therefore, both theories on the treatment of color were not exclusive, but were part of the same process, but in different phases of it. [0019] With the emergence of digital cameras and televisions, and after monitors for computer equipment during the 20th century, image processing was established as a multidisciplinary field, where a wide range of specialists, scientists and technicians found shelter, but also of creatives, designers and artists. One of the problems they encountered was that of converting color images to grayscale (black and white for the general public) without losing the lightness, hue and saturation properties that this visual element offers in the perception [16]. The first converters used light intensity, removing information from both saturation and hue. As a first solution, the use of "weights" in each RGB channel was determined - the RGB color system is the de facto standard, although there are others such as CIE LAB - in such a way that the R channel was given greater prominence over the G or B, the latter being the one that had a lower weight, thus maintaining the differences in hue together with those in luminosity. This type of converters assumed questions of human perception for their development and established scientific calculations to determine the weights. [0021] There is a second line of converters that weight the value of the original RGB color by the contrast in each region of the image to establish a differentiation according to the relationship of each pixel with its environment [17]. The local contrast of each pixel indicates its relevance within the image in order to determine its position in the final gray scale. To carry out this task, it is necessary to apply specific algorithms and processing in each pixel (or in each group of pixels) that depend on local circumstances, and in some cases global with the rest of the image. [0023] Converters using "pesos": [0024] • Methods such as CIECAM97, L * a * b * lum, XYZ lum or YC 1- Cb Lum. [0025] • Patents: [0027] o Method and device for use in converting a color image into a grayscale image. (US8355566B2) [0029] o Method and apparatus for converting a color image to grayscale (US8594419B2). [0030] o Method of converting color image into grayscale image and recording medium storing program for performing the same (US8526719B2). [0032] o Method and device for use in converting a color image into a grayscale image (US7382915B2). Use filter-shaped masks. [0034] Converters that analyze the contrast in each region (locally, globally, or both): [0035] • Methods such as Color2Gray [18]. [0036] • Patents: [0038] o Color to monochrome conversion (US4977398A). [0040] o Mapping of color images to black-and-white textured images (US5153576A). [0042] o Image processing for converting color images into monochrome pattern images (US5726781A). [0044] o System for black and white printing of colored pages (US5898819A). [0046] o Printing black and white reproducible color documents (US5701401A) [0048] o Color transforming method (US6101272A). [0050] Other options: [0051] • Method for converting a video signal into a black / white signal (US4257070A). [0052] It uses channels with visual properties: intensity, hue, texture and painterly effect and applies thresholds. [0054] Summary of the main problems: [0055] • The conversion of color from its three dimensions: hue, lightness and saturation. With the combination of the three RGB channels, a gray scale is obtained that measures the luminosity. With the use of weights in each channel, the hue is also introduced, but the final combination is not easy starting from the RGB system and without including saturation. . [0056] • Establishing a scale of luminosity, and even saturation, a priori is easy, but determining the hue is much more complex. [0057] • Local contrast analysis is effective when it is high, but not when it is medium or low. This causes that the colors, in regions where the contrast is not very high, are in low values in the final grayscale, although their original colors have a higher value in their lightness, hue or saturation properties. [0058] • The local or global assessment where each pixel is compared with its environment establishes a final scale linked to the structure of the color composition of the image, but it is complex to compare the results between several images, especially due to their properties. [0060] Brief description of the invention [0062] The present invention relates to a method and a system defined according to the claims. The invention proposes to carry out the conversion of color to grayscale at the pixel level thanks to a color system that is based on the studies on the color of Schopenhauer, the theory of opposite colors of Hering and the recent advances in the knowledge of the physiology and function of the retina provided by neuroscience. This color system allows the generation of a hierarchy related to the neuronal activity of the retina and, in addition, determines the category of each color, either warm or cold, in order to differentiate similar values in the hierarchy - such as red with green— and be able to differentiate them to maintain contrast. That contrast, which exists in the original color properties (lightness, hue, and saturation), is often lost in conversion. The transformation is carried out in two steps: first, the value of each pixel in the hierarchy is obtained and, secondly, the value is increased or decreased according to the category of warm or cold to which it belongs. [0064] The invention has various applications in computer editing tools for graphic designers, artists and image experts where color is used with communication strategies and in need of objectivity. In addition, taking into account that accessibility is a key issue in our society and that more than 70% of communication is visual, it is also established as an important field of application that of systems or supports for people with problems to distinguish colors (achromatopsia, dyschromatopsia, especially color blindness: protanopia, deuteronopsia, etc.). [0066] The present invention can be implemented with physical hardware components or with software in a computer program executable on the processor of a computer or similar device. The invention employs two complementary bio-inspired pathways, called ON and OFF. By road, the route followed by the set of signals that carry certain information. The ON pathway describes activity and the OFF pathway describes inactivity (although, for simplicity, only the ON path will be used in this document). [0068] In the present invention, each channel consists of four channels, named L, M, S and LM, all with values between 0 and 1. The first receives the signal from the R channel (long wave signal, which reports the activity in the low-frequency range of the visible spectrum), the second from G (medium-wave signal, which reports activity in the mid-frequency range of the visible spectrum), the third from S (short-wave signal, which reports activity in the high frequency range of the visible spectrum), and the last, LM, is the sum with saturation of the activity in R and G. The total activity of the pathway, according to the present invention, is defined as the weighted sum of partial activities in each channel and it is assumed that all channels contribute equally. The result is a hierarchy or scale that orders colors in accordance with the activity of the retina according to Schopenhauer. In this scale, normalized in the range [0,1], the main colors have the following values: [0069] White = 1, Yellow = 3/4, Red = 1/2, Green = 1/2, Blue: 1/4, Black = 0. [0071] However, there is no differentiation of warm and cold colors, as an example, the basic colors red and green are at the same point on the scale, with a value of 1/2, so a second transformation is necessary to differentiate them. . The proposal is to increase the activity value when it is a warm color and reduce it when it is a cold color through a second transformation stage depending on the color category: [0072] • We define that a pixel has a warm color associated with it when its value in the L channel is greater than 0.5 in the ON way. [0073] • We define that a pixel has a cold color associated with it when its value in the L channel is equal to or less than 0.5 in the ON way. [0075] This second stage determines the final greyscale value of the conversion. The improvements and technical advantages of this converter in relation to others are mainly the following: [0076] • The ability to convert lightness, hue, and saturation properties to grayscale from a bio-inspired color hierarchy, where all three properties are related and not just one or two of them. [0077] • The distinction of the categories of warm and cold and the determination of their intensity level establish the distinction between opposite colors that have the same level of the hierarchical conversion scale, improving the final conversion. [0078] • Reduction in computational complexity: when processing at the pixel level, without the need to analyze its context, which achieves a very significant reduction in the computation required to transform RGB color into gray levels. [0080] Solution of the main problems: [0081] • The conversion of color from its three dimensions: hue, lightness and saturation. With the combination of the three RGB channels, a gray scale is obtained that measures the luminosity. With the use of weights in each channel, the hue is also introduced, but the final combination is not easy starting from the RGB system and without including saturation. The transition from a homogeneous three-channel model to a four-channel model facilitates the definition of a quantitative hierarchy in line with the theory of opposite colors that takes into account the properties of lightness, hue and saturation. [0082] • T he local contrast analysis is effective when it is high, but not when it is medium or low. This causes that the colors, in regions where the contrast is not very high, are in low values in the final gray scale, although their original colors have a greater expressive value. In the present proposal there is no local analysis of the contrast, but the exclusive categories of hot and cold are used, which are obtained from one of the channels. [0083] • The local or global assessment where each pixel is compared with its environment establishes a final scale linked to the structure of the color composition of the image, but it is complex to compare the results between several images, especially when comparing each color . The conversion in the present invention is specific, it focuses on the analysis of the RGB values of the pixel itself, with which there is no adjustment determined by the relationship with other pixels in the image. [0085] In short, the main problems of converting RGB to gray levels are solved with a universal model in which the contrast between colors is enhanced according to the category of the color itself (warm / cold), and not depending on local contrast analysis. . The fact of not depending on the structure of the composition of the image and the local relationships facilitates the relationship between images - all have the same same conversion criteria — and therefore their comparison. In addition, the proposal includes two constants that control the increase (in the warm category) or decrease (in the cold category) of the final intensity in the conversion, which allows adjusting the final result. [0087] Brief description of the figures [0089] Fig. 1. General diagram of the stages of the color converter applied to each pixel of the image. [0090] Figs. 2. Known color systems. Fig. 2A Runge's color sphere; Fig. 2B Munsell sphere; Fig. 2C color wheel with primary and secondary colors; and Fig. 2D Kueppers hexagon. [0091] Fig. 3. Relationship between basic colors and gray scale in relation to the activity of the retina according to Schopenhauer. [0092] Fig. 4. Scheme of the neuronal structure of the retina in relation to color. Transformation of the information capture in a trichromatic system to one of four channels according to the invention. [0093] Fig. 5. Basic diagram of the first conversion stage according to the invention. Fig. 6. Color space generated with the first stage of the invention and its relationship with the "A" value of activity. [0094] Fig. 7. Color space generated with the first stage of the invention and its relationship with the color categories (light-warm, warm, cold and cold-dark). [0095] Fig. 8. Basic diagram of the steps of the invention. [0096] Figs. 9A-9E. Conversion according to the invention of an image Fig. 9A and the results obtained with different configurations: Fig. 9B with W = 0 and C = 0, without increase or decrease in hot and cold areas; Fig. 9C with W = 0.32 and C = 0.16; Fig. 9D high contrast applied for warm areas W = 1, and C = 0; and Fig. 9E high contrast applied in cold areas, W = 0 and C = 1. [0097] Figs. 10A-10D. Ishihara color charts for the detection of color blindness and its conversion with cieY and according to the invention. [0098] Figs. 11A-11I. Comparison of the final conversion with weight and contrast converters. Fig. 11A illustrates the original image: Monet's "Rising Sun"; Fig. 11B first conversion according to the hierarchical scale; Fig. 11C shows the determination of the hot and cold category areas; Figs. 11D-11G show the results obtained with weight converters, Fig. 11E shows the results obtained with converter by local contrast, and Fig. 11F shows the results obtained with the proposed converter. [0099] Fig. 12. Block diagram of an embodiment of the system. [0101] Detailed description of the invention [0103] a) Change from the attic trichromatic model to one of four channels [0105] In the present invention, the theory of opposite colors and the trichromatic theory are combined to go from a trichromatic model (RGB) to one of opposite processes with four channels that facilitates the transition from RGB color to grayscale. [0107] The passage from three to four channels is inspired by the neural structures of the retina and the lateral geniculate nucleus, which are involved in the first stages of color processing (see figure 4): [0108] * Cones 21 The first ones involved in color recognition are found in the retina and are divided into three types according to their response to three wavelengths in light: L (long), M (medium) and S (short). The three types of cones correspond respectively to the R, G and B channels of the trichromatic system, [0110] * Ganglion cells 22. They are established in two ways, one that determines the intensity and the other its absence, called ON 23 and OFF 24, respectively, and there are three types of cells in each: magnocells 26, parvocells 25 and koniocells 27. While that ganglion cells 22 are configured as follows: [0111] • Magnocells 26: known as LM, they perform the sum with saturation of the L and M signals. [0112] • Parvocells 25: there are two groups, some carry the L channel signal and others the M channel. [0113] • Koniocells 27: carry the S channel signal. [0115] b) Implementation of a converter [0117] b.1) First stage of conversion [0119] The main idea is to obtain the intensity value of each pixel by transforming the RGB values according to a scale that allows maintaining the color properties. Us We based on the activity value defined in Schopenhauer's color theory and the four-channel model obtained in the previous step to establish the initial value in gray scale. This value is obtained as: [0121] Equation 1: A = LM + L + M + S where LM = min ( LM, 1) [0123] Being L = R, M = G, S = B and LM = L + M , and using A as the initial gray scale value, according to the first stage of this conversion (see figure 5). All values are normalized in the interval [0,1]. Thus, for example, the yellow color, coded as (1,1,0) in RGB, becomes (1,1,0,1) in four channels (L, M, S, LM) and the associated activity value is A = 3/4 = 0.75. [0125] As we have indicated previously, two opposing visual pathways are established, called ON and OFF, related to the activity value or its absence respectively. This system is related to Schopenhauer's qualitative division, where two opposite parts are established. To explain the operation according to the present invention of a converter from RGB to gray levels, it is not necessary to use both ways and it is simplified by using only the ON way. [0127] Second stage of conversion: Differentiation between warm and cold. [0129] The value A, obtained with the previous stage, determines the position of each color in an initial hierarchy, where the original R and G channels are located in a symmetrical manner (see figure 6). This means that a red color and its green opposite will obtain the same A value. For example, for RGB ( 1,0,0 ) and RGB ( 0,1,0 ) A = 0.5 in both cases, for RGB (0.5,0,0) and RGB (0,0.5,0), A = 0.375 , or for RGB (0,5,0.2,0) and RGB ( 0.2,0,5,0 ), A = 0.35 . To obtain a more effective conversion, it is necessary to establish the differentiation between both channels, for which we use the warm-cool characteristic, increasing the value in grayscale for warm colors and reducing it for cold colors. The relationship between the channels and both categories is: [0130] • Warm: preponderance of L and LM. [0131] • Cold: preponderance of M and S [0132] In the conversion, the L channel controls both the influence of the LM and the L, so the definition of the warm category is implemented as: [0134] and from the cold category as: [0137] Channel -L is the one belonging to the OFF channel, although, for simplification reasons, it was decided not to use the OFF channel and to use the following relationship for the cold category: [0140] On the sphere where the color space is represented after the first stage of the conversion, the limits of both categories are shown through the influence of the L channel (see figure 7). The subcategories of light-warm and dark-cold are defined when the activity values are higher than 0.75 or lower than 0.25 and do not provide greater functionality to this model - the first falls within the category of warm and the second within the category of cold. [0142] Having defined which colors are warm and which are cold, an additive factor is now applied that increases the value in the conversion to grayscale for the former and reduces it for the latter. Equation 2 formalizes the operation: preferably, a sigmoid function is used to obtain a smooth transition and increase in a non-linear way the warm values (when L> 0.5) and reduce them for cold colors (when L <= 0.5) and the final value to the interval [0,1]. Any other function that approximates this is used. [0146] To be able to adjust the change due to the warmth / coldness of the color separately, the parameter a is introduced, which can take two configurable values: W if the color is warm and C if it is cold, both in the interval [0,1 ]: [0148] if L> 0.5 a = /; 0 <= W <= 1 [0149] if L <0.5 a = C; 0 <= C <= 1 [0151] In this way, A '(see figure 8) will be the final value in the gray scale, obtained after the second stage of the conversion. [0153] In fig. 9A illustrates an image with differentiated warm and cool colors to check how to adjust the settings for a suitable result. In fig. [0154] 9B, the result after the first stage of the conversion, without increasing or reducing the hot and cold zones. It is appreciated that the expressiveness of the color is low, yellow stands out, and cyan and magenta differ little. In fig. 9C, an adjustment is made to obtain a balanced result, where orange and magenta stand out at high levels over green (which remains at a medium level), and blue and cyan are slightly reduced at lower levels. In figs. 9D and 9E, a high enhancement factor is applied for hot and cold areas respectively. The differences of applying one criterion or another and the advantage of adjusting to obtain the most suitable conversion depending on the image and the objectives are appreciated, although it is possible to determine default settings. [0156] In fig. 10, the application of the converter is shown in various color charts of the Ishihara test for the detection of color blindness (in the first column), and how the CIY converter, illustrated in the second column, is unable to detect the differences between red and green, while the transformation according to the invention does determine that difference and displays the corresponding number in the third column. More specifically: In fig. 10A shows card 1, number 12 is visible for all cases, with or without color blindness. In figs. 10B and 10C show cards 9 and 11, where numbers 74 and 6 are not visible, when there are problems in stopping red and / or green. In fig. 10D shows card 17, where, if only 4 is visible and little or no 2, it shows problems with red, and if it is the other way around, with green. A classical converter like cieY is unable to display any of the numbers (see second column), whereas the present invention does so in all cases (see third column), thus maintaining the properties of the color in the conversion. [0158] Finally, in fig. 11A shows the image of the painting "Rising Sun" by Monet. In fig. 11B the conversion is carried out according to the first stage of the conversion, where the hierarchical scale is used. In fig. 11C shows the image areas of the warm and cold categories. Next, the results of various converters are compared: converters with "weights" in figs. 11D-11G; contrast converters in fig. 11H and the second stage of the conversion in FIG. 11I. If we look at the sun, which clearly stands out from the rest of the color image, we can see the differences between the various converters. In a general way, of the rest of the converters, only the one that uses the local contrast, color2gray as shown in fig. 11H, get it to appear in the featured conversion. If we see the conversion of the first stage, the result is better than the other converters of «pesos» (something else stands out), but it is lower than contrast Color2gray of FIG. 11H, but applying the warm-cold categories of the second stage of the conversion improves the result (it stands out from the background clearly) as shown in fig. 111. Furthermore, if we look at the rest of the elements where there is less local contrast (especially the boats in the background), color2gray in fig. 11H hardly differentiates them, while applying the present invention, as evidenced by fig. [0159] 11I, yes. [0161] The practical utility of the present invention is very considerable. It can be implemented in both hardware and software in digital cameras, mobile applications, tablets and computers, for the treatment of images and their editing in scientific analysis and also for creative and artistic purposes. In addition, its field of action can be extended to artificial vision and in general to applications where it is necessary to obtain a representation in gray scale without losing the basic properties of the color of luminosity, hue and saturation, and even where there are problems of detection of the color (achromatopsia, dyschromatopsia, especially color blindness: protanopia, deuteronopsia, etc.). [0163] In a global and comparative way with other solutions, this invention has as technical improvements: [0164] • In relation to converters that go pixel to pixel: it maintains in the conversion the properties of luminosity, hue and saturation, which can be demonstrated by applying the Ishihara test on color blindness, where the converter passes the tests (see figure 10). [0165] • In relation to the converters that evaluate contrast: when evaluating pixel by pixel, performance is improved, obtaining similar results in conversion (see figure 11). [0167] In fig. 12 an example functional block diagram of a system implementing the invention is illustrated. The system can be implemented in a computer, understood in a broad sense any electronic device with digital storage and processing capacity (for example, an FPGA). [0169] The system for converting a digital color image to a digital grayscale image has an input unit 32 that obtains, from pixels of a color image 31, the value of each pixel in the three primary channels R 33, G 34, and B 35. The system has a process unit 46, which may include a microprocessor, to carry out conversion tasks and operations. Specifically, the functional architecture of the processing unit 46 may incorporate a channel conversion module 36 and an activity counting module 41. [0171] The channel conversion module 36 normalizes the three primary channels R, G, and B to obtain the corresponding normalized channel L 37, M 38, and S 39. 32 also generates a fourth channel LM 40 by adding, with saturation to 1, the L 37 and M 38 normalized primary canals. [0173] In the processing unit 46, the gray scale value is initially obtained as the weighted sum of the four channels 37-40 and, to achieve higher quality in the conversion, as indicated above, the value is increased when the channel normalized L 37 is greater than 0.5 and decreases when it is less than 0.5. A user interface 42 allows you to enter values for the constants W, C. The constant W modifies the contrast for the warm colors of the image 31, while the constant C modifies the contrast for cool colors. These constants are transmitted to the activity counting module 41 of the processing unit 46 to carry out the operations already indicated in the previous equations. [0175] The system also has an output unit 44 for reproducing the gray activity value calculated in the processing unit 46 for the pixels of the original color image 31 and can thereby display a grayscale image 43. [0176] Algorithm scheme [0178] Image = new OBimage ('RGB'); // image object in RGB, is the input image [0179] image_grayscale = new OBimage ('grayscale'); // grayscale image object, is the output image [0181] for (_i = 0; _i <image.width; _i ++) { [0182] for (_j = 0; _j <image.height; _j ++) { [0183] _pixel = getPixel (image.data, _i, _j); // function to extract the RGB channels from the pixel [0184] //one. extract RGB values and pass them to L, M, LM and S [0185] L = _pixel.rgb.R / 255; '/ R channel normalized in the interval [0,1] [0186] M = _pixel.rgb.G / 255; // G channel normalized in the interval [0,1] [0187] S = _pixel.rgb.B / 255; // channel B normalized in the interval [0,1] [0188] LM = max (L + M, 1); [0189] //two. calculate the A value for L, M, LM and S [0190] A = (L + M + S + LM) / 4; // value A [0191] //3. calculate the value A 'for L, M, LM and S [0192] //3.1 Set the constants W and C [0193] W = 0.8; // for example a high value [0194] C = 0.2; // for example a low value [0195] //3.2 Determine the color category: warm or cold, and its level. [0196] if (L> 0.5) then a = W else a = C; [0197] //3.3 Apply equation 2 that extends (warm) or reduces (cold) the value A A '= max (min (A + (_ rangeC * ((1 / (1 + exp (-3 * ((2 * L) - 1)))) - 0.5))), 1), 0); [0198] //4. Load value A 'in image [0199] _pixel.grayscale = A '* 255; // pass to the value of pixels in the scale 0-255 putPixel (imagen_grayscale.data, _pixel.grayscale, _i, _j); // function to load the pixel value} [0200] } [0201] Bibliography [0203] [1] R. Arnheim, Art and visual perception: A psychology of the Creative eye, Univ of California Press, 1956. [0204] [2] D. A. Dondis, A primer of visual literacy, Mit Press, 1974. [0205] [3] E. H. Gombrich, Illusion and art. A study in the psychology of pictorial representation, Oxford, 1959. [0206] [4] I. Newton, Optics: or a treatise of the refections, refractions, inflections and colors of light, William Innys at the West-End of St. Paul’s, 1730. [0207] [5] J. W. Goethe, Theory of colors, MIT press, 1840. [0208] [6] A. Schopenhauer, On Vision and Colors, Pricenton Architectural Press, 2010. [0209] [7] H. V. Helmholtz, "LXXXI. On the theory of compound colors," Philosophical Magazine A, vol. 4, pp. 519-534, 1852. [0210] [8] E. Hering, Ueber individuelle Verschiedenheiten des Farbensinnes, 1885. [0211] [9] J. Pawlik, Theorie der Farbe, 1976. [0212] [10] P. O. Runge, Color Sphere, Pricenton Architectural Press, 2010. [0213] [11] A. H. Munsell, Atlas of the Munsell color system, Wadsworth, Howland & Company, Incorporated, Printers., 1915. [0214] [12] H. Kueppers, The basic law of color theory, Barrons Educational Series Incorporated., 1982. [0215] [13] B. Berlin and P. Kay, Basic color terms: Their universality and evolution, 1991. [0216] [14] E. Rosch, "The nature of mental codes for color categories," Journal of experimental psychology: Human perception and performance, vol. 1 p. 303, 1975. [0217] [15] D. Teller, "Vision and the Visual System," E. John Palmer, Ed., 2014. [0218] [16] R. Bala and R. Eschbach, "Spatial color-to-grayscale transform preserving chrominance edge information," Color and Imaging Conference, vol. 1, pp. 82-86, 2004. [0219] [17] J. G. Kuk, J. H. Ahn and N. I. Cho, "A color to grayscale conversion considering local and global contrast," Asian Conference on Computer Vision, pp. 513-524. [0220] [18] A. A. Gooch, S. C. Olsen, J. Tumblin and B. Gooch, "Color2gray: salience preserving color removal," ACM Trans. on Graphics, vol.24, pp.634-639, 2005.
权利要求:
Claims (6) [1] 1. Computer-implemented method to convert a digital color image (31) to a digital grayscale image (43) comprising the steps: - obtaining, for a plurality of pixels of the color image (31), the value of each pixel in the three channels R, G, and B (33,34,35); - normalize the three primary channels R, G, and B to obtain the normalized channels L, M, and S (37,38,39); - generate an additional fourth normalized channel LM (40) by adding the channels L (37) and M (38) with saturation, where the sum with saturation is the sum of the L channel (37) and the M channel (38) , if said sum is less than unity, or unity otherwise; - determining the activity, A, as the value of each pixel in a gray scale according to the values of the L, M, S and LM channels (37,38,39,40); - determine the final value of each pixel, A ', in the grayscale image (43), overweighting activity A for warm colors if L is greater than 0.5, and underweighting activity A otherwise, for cold colors if L is less than or equal to 0.5. [2] 2. Method according to claim 1, where, to calculate the final scale value of grays, a function A '= max (m in ( [3] 3. System to convert a digital color image (31) to a digital image in grayscale (43) comprising: - an input unit (32) configured to obtain, for a plurality of pixels of the color image (31), the value of each pixel in the three channels R, G, and B (33,34,35); - a processing unit (46) configured to: - normalize the three primary channels R, G, and B to obtain the normalized channels L, M, and S (37,38,39); - generate a fourth additional normalized channel LM (40) by adding saturation of channel L (37) and channel M (38), where the sum with saturation is the sum of channel L (37) and channel M (38 ), if said sum is less than unity, or unity otherwise; - determining the activity, A, of each pixel according to the values of the L, M, S and LM channels (37,38,39,40) as an initial gray scale value; - determine the final value of each pixel, A ', in the grayscale image (43), overweighting activity A, for warm colors if L is greater than 0.5, and underweighting activity A, otherwise, for colors cold. - an output unit (44) configured to display the grayscale image (43). [4] 4. System according to claim 3, wherein to calculate the value of each pixel in grayscale, the activity value A is modified according to a function A ': A '= max (m in (A (a * (i + e_31 (2¿_1) - ° .5)), V), 0) where A = LM + L $ + M + S, where LM = m in (LM, 1), where the value of the parameter a corresponds to one of the constants, W: to modify the contrast of regions with warm colors in the color image (31), or C: to modify the contrast in regions with cold colors; so that: if L> 0.5 a = /; 0 <= W <= 1; and if L <0.5 a = C; 0 <= C <= 1. [5] System according to claim 4, further comprising a user interface (42) for receiving and inputting the values of the constants W, C and for transmitting them to the processing unit (46). [6] A computer program product comprising instructions for carrying out the method defined in claims 1 or 2, when the program instructions are executed on a processor of a computer.
类似技术:
公开号 | 公开日 | 专利标题 Zhang et al.2017|Underwater image enhancement via extended multi-scale Retinex Jefferson et al.2006|Accommodating color blind computer users Rizzi et al.2004|From retinex to automatic color equalization: issues in developing a new algorithm for unsupervised color equalization Čadík et al.2008|Evaluation of HDR tone mapping methods using essential perceptual attributes EP2798830B1|2016-03-16|Spectral synthesis for image capture device processing WO2018201662A1|2018-11-08|Lip color rendering method, apparatus, and electronic device Gronchi et al.2017|A variational model for context-driven effects in perception and cognition Ananto et al.2011|Color transformation for color blind compensation on augmented reality system Fotios et al.2017|Investigating the chromatic contribution to recognition of facial expression Chen et al.2014|Preference for color‐enhanced images assessed by color deficiencies Olkkonen et al.2016|Color constancy and contextual effects on color appearance US9426333B2|2016-08-23|Illusion analyzing apparatus, apparatus for generating illusion-considered image for which illusion is taken into consideration to allow perception according to original image, illusion analyzing method, method of generating illusion-considered image for which illusion is taken into consideration to allow perception according to original image, and program ES2774013B2|2021-08-11|METHOD AND SYSTEM TO CONVERT A DIGITAL IMAGE FROM COLOR TO GRAY SCALE Meylan2006|Tone mapping for high dynamic range images Provenzi2016|A differential geometry model for the perceived colors space JP6765519B2|2020-10-07|Color processing program, color processing method, color sensation inspection system, output system, color vision correction image processing system and color vision simulation image processing system Rudd2016|Retinex-like computations in human lightness perception and their possible realization in visual cortex JP6949795B2|2021-10-13|Image processing equipment, image processing system, image processing method, and program Sandnes2017|On-screen colour contrast for visually impaired readers Murray et al.2019|Visual perception and natural illumination Salvador2004|Shadow segmentation and tracking in real-world conditions US10991082B2|2021-04-27|Determining an optimality coefficient of an image Pendhari et al.2018|Video Processing in Visual System for Color Detection for People with Tritanopia US20200396434A1|2020-12-17|Image White Balance Processing System and Method US20220036603A1|2022-02-03|Image processing for increasing visibility of obscured patterns
同族专利:
公开号 | 公开日 ES2774013B2|2021-08-11|
引用文献:
公开号 | 申请日 | 公开日 | 申请人 | 专利标题 EP0500327A2|1991-02-20|1992-08-26|Canon Kabushiki Kaisha|Image processing apparatus| US20100254601A1|2009-04-03|2010-10-07|Hong Kong Baptist University|Method and device for use in converting a colour image into a grayscale image| US20110110584A1|2009-11-09|2011-05-12|Peter Majewicz|Method And Apparatus For Converting A Color Image To Grayscale| CN106856001A|2016-12-08|2017-06-16|彭志勇|The store method of gray level image and the acquisition methods of gray level image original pixels| CN108230405A|2017-11-30|2018-06-29|中原智慧城市设计研究院有限公司|Image white balancing treatment method based on gray processing|
法律状态:
2020-07-16| BA2A| Patent application published|Ref document number: 2774013 Country of ref document: ES Kind code of ref document: A1 Effective date: 20200716 | 2021-08-11| FG2A| Definitive protection|Ref document number: 2774013 Country of ref document: ES Kind code of ref document: B2 Effective date: 20210811 |
优先权:
[返回顶部]
申请号 | 申请日 | 专利标题 ES201831253A|ES2774013B2|2018-12-20|2018-12-20|METHOD AND SYSTEM TO CONVERT A DIGITAL IMAGE FROM COLOR TO GRAY SCALE|ES201831253A| ES2774013B2|2018-12-20|2018-12-20|METHOD AND SYSTEM TO CONVERT A DIGITAL IMAGE FROM COLOR TO GRAY SCALE| 相关专利
Sulfonates, polymers, resist compositions and patterning process
Washing machine
Washing machine
Device for fixture finishing and tension adjusting of membrane
Structure for Equipping Band in a Plane Cathode Ray Tube
Process for preparation of 7 alpha-carboxyl 9, 11-epoxy steroids and intermediates useful therein an
国家/地区
|